using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using OneSoft.EntityCore;
using OneSoft.DataAccess;
using BySoft.Server.Common.Entity;
using BySoft.Server.Common.Schema;
using BySoft.Server.Common;

namespace BySoft.Server.DataAccess
{
    public partial class MdStockDA
    {


        private static string GetHeadSQL()
        {
            return @"SELECT A.*
                    FROM MD_Stock A 
                       
                    WHERE 1=1";
        }
        public static DataTable SelectList(string StockID, string StockName, int pageIndex, int PageSize, out int m_count)
        {
            try
            {
                #region SQL Server
                string strcmd = @"select * from MD_Stock where 1=1 ";

                DataAccessParameterCollection dpc = new DataAccessParameterCollection();

                if (!string.IsNullOrEmpty(StockID))
                {
                    strcmd += " and StockID LIKE @StockID";
                    dpc.AddWithValue("@StockID", "%" + StockID + "%");
                }

                if (!string.IsNullOrEmpty(StockName))
                {
                    strcmd += " and StockName LIKE @StockName";
                    dpc.AddWithValue("@StockName", "%" + StockName + "%");
                }

                strcmd += " ORDER BY StockID DESC";
                return DataAccessCommon.ExecuteDataTablePaging(strcmd, pageIndex, PageSize, dpc, out m_count);
                #endregion
            }
            catch
            {
                throw;
            }
        }


     
       
    }
}

